package com.kyrie.lib_sys.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * minio文件配置类
 *
 * @author heefM
 * @date 2025-09-01
 */
@Configuration
public class MinioConfig {

    @Value("${minio.minioUrl}")
    private String minioUrl;

    @Value("${minio.accessKey}")
    private String accessKey;

    @Value("${minio.secretKey}")
    private String secretKey;


    /**
     * 构建一个minio的Cilent
     * @return
     */
    @Bean
    public MinioClient getMinioClient(){
        return MinioClient.builder()
                .endpoint(minioUrl)
                .credentials(accessKey, secretKey)
                .build();
    }



}
